package com.xnyzc.lhy.order.feign.didi;

import com.xnyzc.lhy.common.entity.DiDiRv;
import com.xnyzc.lhy.common.entity.Rv;
import com.xnyzc.lhy.common.entity.netty.StriveCallbackParam;
import com.xnyzc.lhy.order.entity.param.order.OrderDetailParam;
import com.xnyzc.lhy.order.entity.param.synchronization.DriverSingleSynchronousParam;
import com.xnyzc.lhy.order.entity.param.synchronization.LocationSyncParam;
import com.xnyzc.lhy.order.entity.param.synchronization.RealtimeFeeSyncParam;
import com.xnyzc.lhy.order.entity.param.synchronization.StatusCallbackParam;
import com.xnyzc.lhy.order.entity.task.CloseOrderParam;
import com.xnyzc.lhy.order.entity.task.pay.PayInfo;
import com.xnyzc.lhy.order.feign.fallback.didi.DidiServiceFallback;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = "${feign.applicationName.didi}", fallback = DidiServiceFallback.class)
public interface IDidiService {

    /**
     * 调取滴滴同步司机位置
     *
     * @param locationSyncParam 司机同步对象
     */
    @PostMapping("oa/didi/synchronization/getLocationSync")
    DiDiRv locationSync(@ApiParam(name = "locationSyncParam", value = "位置信息") @RequestBody LocationSyncParam locationSyncParam);

    /**
     * 调取滴滴实时计价同步
     *
     * @param realtimeFeeSyncParam 价格信息
     */
    @PostMapping("oa/didi/synchronization/getRealtimeFeeSync")
    DiDiRv getRealtimeFeeSync(@ApiParam(name = "realtimeFeeSyncParam", value = "价格信息") @RequestBody RealtimeFeeSyncParam realtimeFeeSyncParam);

    /**
     * 调取滴滴司机状态同步
     *
     * @param statusCallbackParam 价格信息
     */
    @PostMapping("oa/order/status/statusSync")
    Rv statusCallback(@ApiParam(name = "statusCallbackParam", value = "司机状态信息") @RequestBody StatusCallbackParam statusCallbackParam);

    /**
     * 调取滴滴司机抢单
     *
     * @param striveCallbackParam 司机抢单
     * @return DiDiRv
     */
    @PostMapping("oa/didi/synchronization/getStriveCallback")
    DiDiRv getStriveCallback(@RequestBody StriveCallbackParam striveCallbackParam);

    /**
     * 查询订单详情
     *
     * @param orderDetailParam 查询参数
     * @return
     */
    @PostMapping(value = "/oa/didi/order/getOrderDetail")
    DiDiRv getOrderDetail(@RequestBody OrderDetailParam orderDetailParam);

    /**
     * 查询订单状态
     *
     * @param orderDetailParam 查询参数
     * @return
     */
    @PostMapping(value = "/oa/didi/order/getOrderStatus")
    DiDiRv getOrderStatus(@RequestBody OrderDetailParam orderDetailParam);

    /**
     * 司机抢单结果feign调用
     *
     * @param driverSingleSynchronousParam 抢单结果同步参数
     */
    @PostMapping(value = "/oa/didi/synchronization/driverSingleSynchronousFeign")
    DiDiRv driverSingleSynchronousFeign(@RequestBody DriverSingleSynchronousParam driverSingleSynchronousParam);

    /**
     * 调用支付详情
     *
     * @param closeOrderParam 参数
     * @return PayInfo
     */
    @PostMapping(value = "/oa/didi/checkstand/getPayInfo")
    PayInfo getPayInfo(@RequestBody CloseOrderParam closeOrderParam);
}
